<template>
	<view>
		<view class="evaluate_item">
			<view class="evaluate_info">
				<view class="info_user">
					<view class="user_avatar">
						<image
							:src="item.avatar || 'https://admin.yuanfenjihua.com/admin-api/infra/file/0/get/7d485f174dd88232f08d5d0ea6d05b153a3857402e3ce776d2c1eca015cad0cb.png'"
							mode="aspectFill"></image>
					</view>
					<view class="user_name">
						{{item.patientName || '匿名患者'}}
					</view>
					<view class="user_type yellow">
						{{item.consultaionType || ""}}
					</view>
				</view>
				<view class="info_date">
					{{$getDate(item.createTime) || ""}}
				</view>
			</view>
			<view class="evaluate_star">
				<view class="star">
					<uni-rate :readonly="true" :size="13" :value="item.score" />
				</view>
				<view class="total">
					{{Math.floor((item.score / 5)*100)}}%
				</view>
			</view>
			<view class="evaluate_content">
				{{item.commentContext || ''}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "evaluateItem",
		props: {
			item: {
				type: [Object, String],
				default: () => {
					return {}
				}
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss" scoped>
	.evaluate_item {
		padding: 30rpx 0;
		border-bottom: 1px solid #eee;

		&:last-child {
			border: none;
		}

		.evaluate_info {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.info_user {
				display: flex;
				align-items: center;

				>view {
					margin-right: 15rpx;
				}

				.user_avatar {
					width: 60rpx;
					height: 60rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.user_name {
					font-size: 30rpx;
					color: #333333;
				}

				.user_type {
					padding: 6rpx 10rpx;
					border-radius: 10rpx;
					font-size: 22rpx;

					&.blue {
						color: #3B6CFE;
						background-color: #F3F8FF;
					}

					&.green {
						color: #23CC88;
						background-color: #DEF7ED;
					}

					&.yellow {
						color: #F1AE34;
						background-color: #FDF3E1;
					}
				}
			}

			.info_date {
				font-size: 22rpx;
				color: #999999;
			}
		}

		.evaluate_star {
			padding: 20rpx 0;
			display: flex;
			align-items: center;

			.total {
				margin-left: 10rpx;
				font-size: 24rpx;
				color: #F1AE34;
			}
		}

		.evaluate_content {
			font-size: 26rpx;
			color: #333333;
			line-height: 50rpx;
		}
	}
</style>